<template>
  <view class="c-nav-title-container" :style="{ height: height + 'px', background }">
    <view class="left-box">
      {{ title }}
    </view>
    <view class="right-box" v-if="moreText" @click.stop="tapRight">
      <view class="text">{{ moreText }}</view>
      <nut-icon name="right" size="10"></nut-icon>
    </view>
  </view>
</template>

<script setup>
import { defineProps, ref } from 'vue'
import { getSysInfo } from '@/common/system'
import { useDidShow, getStorage, getStorageSync, navigateBack } from '@tarojs/taro'

const props = defineProps({
  title: {
    type: String,
    default: '我是标题'
  },
  moreText: {
    type: String,
    default: ''
  },
  height: {
    type: String,
    default: '#000'
  },
  background: {
    type: String,
    default: '#FFF'
  }
})

/** 右边点击 */
const emit = defineEmits(['tapRight'])
const tapRight = e => {
  emit('tapRight', e.detail)
}
</script>

<style lang="scss">
@import '@/assets/styles/custom_theme.scss';
.c-nav-title-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  .left-box {
    font-size: 16px;
    line-height: 32px;
    font-weight: 500;
    color: $title-color;
  }
  .right-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 400;
    color: $text-color;
    .text {
      padding: 0 2px;
    }
  }
}
</style>
